package com.dg.gaming.client.gui
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Shape;
	import flash.geom.Rectangle;

	public class BoxImage extends Bitmap
	{
	    public var data  : BitmapData;
	    public var shape : Shape;
	
	    public function BoxImage( width : int, height : int )
	    {
	        data = new BitmapData( width, height );
	        shape = new Shape();
	        super( data );
	    }
	
//	    public function drawRectangle( x : int, y : int, width : int, height: int, ARGBcolor : uint ) : void
//	    {
//	        for( py in 0...width )
//	        {
//	            for( px in 0...height )
//	            {
//	                data.setPixel32( x + px, y + py, ARGBcolor );
//	            }
//	        }
//	    }
//	
	    public function drawCircle( x : int, y : int, r: int, fillColor: uint, lineColor: uint, lineWidth: uint ): void
	    {
	        shape.graphics.beginFill(fillColor);
	        shape.graphics.lineStyle(lineWidth, lineColor);
	        shape.graphics.drawCircle(x, y, r);
	        shape.graphics.endFill();
	        data.draw(shape);
	    }
//	
//	    public function drawEllipse( x : int, y : int, w: int, h: int, fillColor: uint, lineColor: uint, lineWidth: uint ): void
//	    {
//	        shape.graphics.beginFill(fillColor);
//	        shape.graphics.lineStyle(lineWidth, lineColor);
//	        shape.graphics.drawEllipse(x, y, w, h);
//	        shape.graphics.endFill();
//	        data.draw(shape);
//	    }
//	
	    public function drawRect( x : int, y : int, x2 : int, y2 : int, fillColor: uint, lineColor: uint, lineWidth: uint ): void
	    {
	        shape.graphics.beginFill(fillColor);
	        shape.graphics.lineStyle(lineWidth, lineColor);
	        data.fillRect(new Rectangle(x, y, x2, y2), fillColor);
	        shape.graphics.drawRect(x, y, x2, y2);
	        shape.graphics.endFill();
	        data.draw(shape);
	    }
	


		
	}
}